<template>
   <footer class="footer_guide border-1px" v-show="showTabbar">
      <a href="javascript:;" class="guide_item" @click="goto('/msite')" :class="{on: $route.path==='/msite'}">
         <span class="item_icon">
            <i class="iconfont icon-xuanxiang"></i>
         </span>
         <span>首页</span>
      </a>
      <a href="javascript:;" class="guide_item" @click="goto('/search')" :class="{on: $route.path==='/search'}">
         <span class="item_icon">
            <i class="iconfont icon-search"></i>
         </span>
         <span>搜索</span>
      </a>
      <a href="javascript:;" class="guide_item" @click="goto('/order')" :class="{on: $route.path==='/order'}">
         <span class="item_icon">
            <i class="iconfont icon-dingdan"></i>
         </span>
         <span>订单</span>
      </a>
      <a href="javascript:;" class="guide_item" @click="goto('/profile')" :class="{on: $route.path==='/profile'}">
         <span class="item_icon">
            <i class="iconfont icon-geren"></i>
         </span>
         <span>我的</span>
      </a>
   </footer>
</template>

<script>
export default {
   name: 'Tabbar',
   methods: {
      goto(url) {
         this.$router.push(url)
      }
   },
   computed: {
      showTabbar() {
         return this.$route.meta.tableBar
      }
   }
};
</script>

<style lang="stylus" scoped>
@import'../../common/stylus/mixins.styl'

.footer_guide  //footer
    top-border-1px(#e4e4e4)
    position fixed
    z-index 15
    left 50%
    bottom 0
    transform translate(-50%)
    background-color #fff
    width 100%
    max-width: 750px
    height 50px
    display flex
    .guide_item
      display flex
      flex 1
      text-align center
      flex-direction column
      align-items center
      margin 5px
      color #999999
      &.on
        color var(--theme)
      span
        font-size 12px
        margin-top 2px
        margin-bottom 2px
        .iconfont
          font-size 22px
</style>